/* 
	Append baseline, follow-up 1 and follow-up 2, 
	and merge with administrative data
*/

use		"$data/2_processed/baseline_clean.dta", clear 
append 	using "$data/2_processed/followup1_clean.dta"
append 	using "$data/2_processed/followup2_clean.dta"

sort	id survey_round

* Replacing gender, treatment if missing with previous round
by id:	replace sex = sex[_n-1] if sex ==.
by id:	replace treat = treat[_n-1] if treat ==.

* Merge with administrative data
merge m:1 id using "$data/1_raw/admin-data.dta", keepusing(grade_2019_admin)
drop _merge

* Save
save 	"$data/2_processed/panel_appended.dta", replace

********************************************************************************
*  END
********************************************************************************
